﻿using Coolzon.Realtime.Contracts.CommandData;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Coolzon.UI.Common.RealtimeProxies
{
    /// <summary>
    /// 响应数据工厂
    /// </summary>
    public class ResponseHandlerFactory
    {
        public static IResponseHandler CreateHandler(byte scenario, byte command)
        {
            IResponseHandler handler = null;

            if (scenario == SCENARIO.CONNECT)
            {
                if (command == COMMAND.CONNECT.UPLOADVIEWSTATE)
                {
                    //handler = new RespUploadViewStateHandler();
                }
                else if (command == COMMAND.CONNECT.SWITCHMAINSERVER)
                {
                    //handler = new SwitchMainServerHandler();
                }
                else if (command == COMMAND.CONNECT.RECONNECT)
                {
                    //handler = new RespReconnectHandler();
                }
            }
            if (handler != null)
            {
                return handler;
            }

            if (scenario == RESPONSE_SCENARIO.CONNENT)
            {
                if (command == RESPONSE_COMMAND.CONNECT.LOGIN)
                {
                    // 登录
                    handler = new LoginHandler();
                }
                else if (command == RESPONSE_COMMAND.CONNECT.LOGOUT)
                {
                    //handler = new LogoutHandler();
                }
                else if (command == RESPONSE_COMMAND.CONNECT.GETSOLUTIONLIST)
                {
                    // 获取方案列表
                   // handler = new RespGetSolutionListHandler();
                }
                else if (command == RESPONSE_COMMAND.CONNECT.GETDOMAINLIST)
                {
                    // 获取控制域列表
                    //handler = new RespGetDomainListHandler();
                }
                else if (command == RESPONSE_COMMAND.CONNECT.ENTERDOMAIN)
                {
                    //handler = new RespEnterDomainHandler();
                }
                else if (command == RESPONSE_COMMAND.CONNECT.CREATEDOMAIN)
                {
                   // handler = new RespCreateDomainHandler();
                }
                else if (command == RESPONSE_COMMAND.CONNECT.LEAVEDOMAIN)
                {
                   // handler = new RespLeaveDomainHandler();
                }
                else if (command == RESPONSE_COMMAND.CONNECT.SYNCVIEWSTATE)
                {
                    //handler = new RespSyncViewStateHandler();
                }
                else if (command == RESPONSE_COMMAND.CONNECT.GETDOMAININSTANCEMODE)
                {
                   // handler = new RespGetDomainInstanceModeHandler();
                }
                else if (command == RESPONSE_COMMAND.CONNECT.UPDATECLIENTSTATUS)
                {
                    //handler = new RespUpdateClientStatusHandler();
                }
                else if (command == RESPONSE_COMMAND.CONNECT.CHECKCLIENTSTATUS)
                {
                   // handler = new RespCheckClientStatusHandler();
                }
                else if (command == RESPONSE_COMMAND.CONNECT.GETVIEWSTATE)
                {
                   // handler = new RespGetViewStateHandler();
                }
                //else if (command == RESPONSE_COMMAND.DATAEVENT)
                //{
                //    handler = new RespDataEventHandler();
                //}
            }
            else if (scenario == RESPONSE_SCENARIO.SCENE)
            {
                if (command == RESPONSE_COMMAND.SCENE.OPENSCENE)
                {
                   // handler = new RespOpenSceneHandler();
                }
                else if (command == RESPONSE_COMMAND.SCENE.LOOPSCENE)
                {
                    //handler = new RespLoopSceneHandler();
                }
                else if (command == RESPONSE_COMMAND.SCENE.SWAPAREA)
                {
                   // handler = new RespSwapAreaHandler();
                }
                else if (command == RESPONSE_COMMAND.SCENE.MOUSEEVENT)
                {
                    //handler = new RespMouseEventHandler();
                }
                else if (command == RESPONSE_COMMAND.SCENE.CLOSESCENE)
                {
                   // handler = new RespCloseSceneHandler();
                }
                else if (command == RESPONSE_COMMAND.SCENE.SETPROPERTYXMLSTRING)
                {
                   // handler = new RespSetPropertyXmlStringEventHandler();
                }
                else if (command == RESPONSE_COMMAND.SCENE.MAGNIFYSCENE)
                {
                   // handler = new RespMagnifySceneHandler();
                }
                else if (command == RESPONSE_COMMAND.SCENE.SHOWLASERPOINTER)
                {
                   // handler = new RespShowLaserPointerHandler();
                }
                else if (command == RESPONSE_COMMAND.SCENE.PARTEVENT)
                {
                    //handler = new RespPartEventHandler();
                }
                else if (command == RESPONSE_COMMAND.SCENE.SCRIPTNETEVENT)
                {
                  //  handler = new RespScriptNetEventEventHandler();
                }
            }
            else if (scenario == RESPONSE_SCENARIO.TABCONTAINER)
            {
                if (command == RESPONSE_COMMAND.TABCONTAINER.CHANGE)
                {
                    //handler = new RespTabChangeHandler();
                }
            }
            else if (scenario == RESPONSE_SCENARIO.SETTING)
            {
                if (command == RESPONSE_COMMAND.SETTING.CHANGECONTROLSTATE)
                {
                    //handler = new RespChangeControlStateEventHandler();
                }
                else if (command == RESPONSE_COMMAND.SETTING.RESETSCENE)
                {
                    //handler = new RespResetSceneEventHandler();
                }
                else if (command == RESPONSE_COMMAND.SETTING.RESETSOLUTION)
                {
                    //handler = new RespResetSolutionEventHandler();
                }
            }
            else if (scenario == RESPONSE_SCENARIO.SOLUTION)
            {
                if (command == RESPONSE_COMMAND.SOLUTION.SWITCH)
                {
                    //handler = new RespSwitchSolutionHandler();
                }
            }
            return handler;
        }
    }
}
